import http from "../request.js";

const header = { "Content-Type": "application/x-www-form-urlencoded" };
const jsonHeader = { "Content-Type": "application/json" };
// post 请求 使用 params get请求 使用 { params }
class SupplierCenter {
  constructor() {
    this.merch_category_listApi =       "/api/hqmerch/merch/merch_category_list2";        // 商户分类
    this.merch_category_list0Api =       "/api/hqmerch/merch/merch_category_list";        // 商户分类
    this.merch_categoryApi =       "/api/hqmerch/apply/merch_category";        // 线下商户分类
    this.merch_index_Api =              "/api/hqmerch/merch/index";                      // 商户搜索
    this.index_getMcc_Api =              "/api/index/getMcc";                      // 汇付所属行业 编码三级联动查询
    this.merch_offline_merch_list_Api =              "/api/hqmerch/merch/offline_merch_list";                      // 线下商户搜索
		this.merchDetailApi =               "/api/hqmerch/merch/detail";                     // 进店，店铺详情
		this.merchgoods_listApi =           "/api/hqmerch/merch/goods_list";                 // 店铺内搜索商品1
		this.merchgoods_list2Api =          "/api/hqmerch/merch/goods_list2";                // 店铺内搜索商品2
    this.merchcategory_listApi =        "/api/hqmerch/merch/category_list";              // 商户店内所有分类
    this.categoryGoodsListApi =        "/api/hqmerch/merch/category_goods_list";              // 商户店内所有分类
    this.applyBankApi =                "/api/hqmerch/apply/bank";              // 获取银行编码列表
	this.areaIdApi =                '/api/index/getArea';  //查询省市id
	this.qrPayApi =                '/api/huifu/scanWechatminiPay'  // 微信扫码支付
  }
  getMerchCategoryList(params) {
    return http.post(this.merch_category_listApi, params || {}).then((res) => res.data);
  }
   getMerchCategoryList0(params) {
    return http.post(this.merch_category_list0Api, params || {}).then((res) => res.data);
  }
  getMerchCategory(params) {
    return http.post(this.merch_categoryApi, params || {}).then((res) => res.data);
  }
  getMerchIndexList(params) {
    return http.post(this.merch_index_Api, params).then((res) => res.data);
  }
  getMccList(params) {
    return http.post(this.index_getMcc_Api, params).then((res) => res.data);
  }
  getMerchOfflineMerchList(params) {
    return http.post(this.merch_offline_merch_list_Api, params).then((res) => res.data);
  }
	merchDetail(params) {
	  return http.post(this.merchDetailApi, params).then((res) => res.data);
	}
	merchgoods_list(params) {
	  return http.post(this.merchgoods_listApi, params).then((res) => res.data);
	}
	merchgoods_list2(params) {
	  return http.post(this.merchgoods_list2Api, params).then((res) => res.data);
	}
  merchcategory_list(params) {
    return http.post(this.merchcategory_listApi, params).then((res) => res.data);
  }
  categoryGoodsList(params) {
    return http.post(this.categoryGoodsListApi, params).then((res) => res.data);
  }
  getApplyBankList(params) {
    return http.post(this.applyBankApi, params).then((res) => res.data);
  }
  getArea(params) {
    return http.post(this.areaIdApi, params).then((res) => res.data);
  }
  qrPay(params) {
    return http.post(this.qrPayApi, params).then((res) => res.data);
  }
}

export const SupplierCenterApi = new SupplierCenter();
